﻿namespace net.zxteam.ZXLexer.Rules.Internal
{
	using net.zxteam.ZXLexer.Tokens;
	using System.Diagnostics.Contracts;

	internal sealed class CharRangeRule : InnerRule, ICharRangeRule
	{
		private readonly char _from, _to;

		internal CharRangeRule(IRule parentRule, char from, char to)
			: base(parentRule)
		{
			_from = from; _to = to;
		}

		public override IToken Accept(IRuleVisitor visitor)
		{
			Contract.Requires(visitor != null);

			return visitor.VisitCharRangeRule(this);
		}

		public char From { get { return _from; } }
		public char To { get { return _to; } }
	}
}
